//===================================================================================
// $$
//
// Coder: Code Milker v1.0
// 0 - upper
// 1 - lower
//===================================================================================


namespace App.Domain.Handlers {
    using System;
    using App.Data;
    using App.Domain.Contracts;

    public class DeleteSkill {
        private readonly ISkillRepository _SkillRepository;

        public DeleteSkill(ISkillRepository SkillRepository) {
            _SkillRepository = SkillRepository;
        }

        public virtual void Execute(Guid skillId) {
            var SkillToDelete = _SkillRepository.GetSkill(skillId);

            if (SkillToDelete != null) {
                _SkillRepository.Delete(skillId);
            }
            else {
                throw new BusinessServicesException("UnableToDeleteVehicleExceptionMessage");
            }
        }
    }
}
